import Taro from '@tarojs/taro'
import { getCoupons } from './service';

export default {

  namespace: 'coupons',

  state: {},

  effects: {
    * init({payload}, { call,put }) {
      const{status ,id}=payload;
      console.log('mine effects payload', payload);
      console.log('mine effects id', id);
      const reel = yield call(getCoupons,status,id);
      console.log('mine effects reel', reel);
        yield put({
            type:'save',
            payload: {reel:reel.list}
          });
    },
  },

  reducers: {
    save(state, { payload }) {
      console.log('home effects payload',payload);
      return {
        ...state,
        ...payload
      };
    },
  },
};
